<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

    <head>
        <title th:text="${pageTitle}"></title>
        <div data-th-replace="layout/head-top"></div>
        <link rel="stylesheet" type="text/css" th:href="@{{path}/common/v3/summernote/summernote-bs3.css?v={v}(path=${staticPath},v=${v})}"/>
    </head>
    <body class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInLeft">
            <div data-th-replace="common/functionDepict"></div>
            <div class="row">
                <form id="agentConfigForm">
                    <div class="col-sm-12">
                        <div class="ibox-title">
                            <h5><small class="m-l-sm">推广中心配置</small></h5>
                        </div>
                        <div class="ibox-content pt10">
                            <div class="form-horizontal">
                                <input type="hidden" name="agentCenterId" th:value="${agentConfigMap['AGENTCENTER']['id']}"/>
                                <input type="hidden" name="agentCenterKey" th:value="${agentConfigMap['AGENTCENTER']['configType']}"/>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 是否开启推广中心</label>
                                    <div class="col-sm-8">
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="ON" name="agentCenter" th:checked="${agentConfigMap['AGENTCENTER']['configMap']['switch']} == 'ON'"/> <i></i><b>开启</b>-开启前台各端推广中心功能
                                            </label>
                                        </div>
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="OFF" name="agentCenter" th:checked="${agentConfigMap['AGENTCENTER']['configMap']['switch']} == 'OFF'"/> <i></i> <b>关闭</b>-关闭前台各端推广中心功能
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <input type="hidden" name="agentUserId" th:value="${agentConfigMap['AGENTUSER']['id']}"/>
                                    <input type="hidden" name="agentUserKey" th:value="${agentConfigMap['AGENTUSER']['configType']}"/>
                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 申请成为推广员</label>
                                    <div class="col-sm-8">
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="ON" name="agentUser" th:checked="${agentConfigMap['AGENTUSER']['configMap']['switch']} == 'ON'"/> <i></i><b>开启</b>-任意普通学员皆可以申请成为推广员，默认一级分成比例为5%，二级为3%
                                            </label>
                                        </div>
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="OFF" name="agentUser" th:checked="${agentConfigMap['AGENTUSER']['configMap']['switch']} == 'OFF'"/> <i></i> <b>关闭</b>-不可申请，只允许后台创建
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <input type="hidden" name="userAuditingId" th:value="${agentConfigMap['USERAUDITING']['id']}"/>
                                    <input type="hidden" name="userAuditingKey" th:value="${agentConfigMap['USERAUDITING']['configType']}"/>
                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 推广员审核</label>
                                    <div class="col-sm-8">
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="ON" name="userAuditing" th:checked="${agentConfigMap['USERAUDITING']['configMap']['switch']} == 'ON'"/> <i></i><b>开启</b>-开启后，学员申请成为推广员需要审核
                                            </label>
                                        </div>
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="OFF" name="userAuditing" th:checked="${agentConfigMap['USERAUDITING']['configMap']['switch']} == 'OFF'"/> <i></i> <b>关闭</b>-学员直接申请成功，不需要审核
                                            </label>
                                        </div>
                                    </div>
                                </div>

                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <input type="hidden" name="userInviteId" th:value="${agentConfigMap['USERINVITE']['id']}"/>
                                    <input type="hidden" name="userInviteKey" th:value="${agentConfigMap['USERINVITE']['configType']}"/>
                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 是否邀请好友成为推广员</label>
                                    <div class="col-sm-8">
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="ON" name="userInvite" th:checked="${agentConfigMap['USERINVITE']['configMap']['switch']} == 'ON'"/> <i></i><b>开启</b>-可以邀请好友成为推广员
                                            </label>
                                        </div>
                                        <div class="radio i-checks">
                                            <label style="padding-left: 0">
                                                <input type="radio" value="OFF" name="userInvite" th:checked="${agentConfigMap['USERINVITE']['configMap']['switch']} != 'ON'"/> <i></i> <b>关闭</b>-无法邀请好友成为推广员，且不具备邀请功能
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 推广收益规则</label>
                                    <div class="col-sm-10">
                                        <textarea id="depict" name="state" class="form-control validate-data" th:text="${agentConfigMap['SALESINCOME']}!=null?${agentConfigMap['SALESINCOME']['configMap']['state']}:''" style="height: 120px;resize: none;" ></textarea>
                                        <span class="help-block m-b-none c-999">请填写推广收益规则</span>
                                        <span class="help-block m-b-none c-999"></span>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="ibox-title">
                            <h5><small class="m-l-sm">推广员结算周期</small></h5>
                        </div>
                        <div class="ibox-content pt10">
                            <div class="form-horizontal">
                                 <div class="form-group">
                                     <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 批量设置推广员结算周期</label>
                                    <div class="col-sm-10">
                                        <div class="radio i-checks">

                                            <label style="height: 30px;">
                                                        <input type="radio"  name="settType" value="1"/><i></i><strong>随时结</strong>-随时可结算与提现
                                            </label>
                                            <br />
                                             <label style="height: 30px;">
                                                        <input type="radio" name="settType" value="2"/><i></i><strong>月结</strong>-自然月，以每月的1-5号为规定的结算提现日，其它时间不可结算与提现
                                             </label>
                                            <br />
                                            <label style="height: 30px;">
                                                         <input type="radio"  name="settType" value="3"/><i></i><strong>年结</strong>-自然年，以每年最后一个月为规定的结算提现日，其它时间不可结算与提现
                                            </label>

                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>

                        <div class="float-e-margins">
                            <input type="hidden" name="incomeId" th:value="${agentConfigMap['SALESINCOME']}!=null?${agentConfigMap['SALESINCOME']['id']}:''">
                            <div class="ibox-title">
                                <h5><small class="m-l-sm">一二级分成及奖励金分成比例</small></h5>
                            </div>
                            <div class="ibox-content pt10">
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 一级分成比例</label>
                                            <div class="col-sm-6">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                    <input class="validate-data form-control" type="text" placeholder="请输入分成比例" name="oneScale" th:value="${agentConfigMap['SALESINCOME']}!=null?${agentConfigMap['SALESINCOME']['configMap']['oneScale']}:''" />
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                                <span class="help-block m-b-none c-999">一级推广员的下线与推广的普通用户消费时，消费金额按此比例给推广员分成，请输入0-100的正整数</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 二级分成比例</label>
                                            <div class="col-sm-6">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                    <input class="validate-data form-control" type="text" placeholder="请输入分成比例" name="twoScale"  th:value="${agentConfigMap['SALESINCOME']}!=null?${agentConfigMap['SALESINCOME']['configMap']['twoScale']}:''"/>
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                                <span class="help-block m-b-none c-999">下线的推广用户消费时，消费金额按此比例给下线分成，请输入0-100的正整数且与奖励金比例之和小于100</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-12">
                                            <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 奖励金比例</label>
                                            <div class="col-sm-6">
                                                <div class="input-group m-b">
                                                    <span class="input-group-addon"><i class="fa fa-balance-scale"></i></span>
                                                    <input class="validate-data form-control" type="text" placeholder="请输入分成比例" name="bonusScale" th:value="${agentConfigMap['SALESINCOME']}!=null?${agentConfigMap['SALESINCOME']['configMap']['bonusScale']}:''" />
                                                    <span class="input-group-addon">%</span>
                                                </div>
                                                <span class="help-block m-b-none c-999">下线的推广用户消费时，消费金额按此比例奖励一级推广员，请输入0-100的正整数且与二级分成比例之和小于100</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>

                        <div class="ibox-content pt10">
                            <div class="form-horizontal">
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-danger" id="saveConfig" type="button">保存配置</button>
                                    </div>
                                </div>
                            </div>
                        </div>

                        </div>

                </form>
            </div>
        </div>
        <div data-th-replace="layout/head-footer"></div>
        <script type="text/javascript" th:src="@{{path}/common/summernote/summernote.min.js?v={v}(path=${staticPath},v=${v})}"></script>
        <script type="text/javascript" th:src="@{{path}/common/summernote/summernote-zh-CN.js?v={v}(path=${staticPath},v=${v})}"></script>
        <script type="text/javascript" th:src="@{{path}/admin/business/agent/config/agent-config.js?v={v}(path=${staticPath},v=${v})}"></script>
    </body>
</html>
